#include"graph.h"
#include <time.h>
#include <stdlib.h>
#include <utility>
#include <ctime>

#define MAXN 1000

using namespace std;

int main()
{
    //int n, e;
    //cout << "请输入顶点数和边数:" << endl;
    //cin >> n >> e;
    //测试输入异常情况
    //int v[5];
    //for ( int i = 0; i < 5; i ++){
    //	v[i] = i;
    //}
    //MGraph<int> graph(v, 5, 1);

    //测试算法效率
    int array[MAXSIZE];
    clock_t startTime, endTime;
    int n;
    for( n = 10; n <= MAXN; n = n * 10){
	for ( int i = 0; i < n; i ++){
        	array[i] = i;
        }
	MGraph<int> graph(array, n , 5);
    	startTime = clock();
    	graph.Bellman_Ford();
	endTime = clock();
        double time = (double)(endTime - startTime) * 1000 / CLOCKS_PER_SEC;
        cout << "n = " << n << ":" << time << "ms" << endl;
    }	
    return 0;
}

